
<div class="toonStatForm">
<? $urlOptions = array ('module' => 'admin', 'controller' => 'stat', 'action' => 'add'); ?>
<form id="stat" action="<?= $this->url($urlOptions) ?>" onSubmit="return saveRow(this);" method="post">
<fieldset>
   <legend>Toons Stats</legend>
   <div class="row">
      <label for="stat_name">Stat Name:</label>
      <span class="form"><?= $this->formText('stat_name', '', array('size' => 15)); ?></span>
   </div>
   <div class="row">
      <label for="stat_min">Min:</label>
      <span class="form"><?= $this->formText('stat_min', '', array('size' => 4)); ?></span>
   </div>
   <div class="row">
      <label for="stat_max">Max:</label>
      <span class="form"><?= $this->formText('stat_max', '', array('size' => 4)); ?></span>
   </div>
</fieldset>
<?= $this->formSubmit('submit', 'Save Stat'); ?>
</form>
</div>

<table id="statList" class="toonStatList" cellspacing="0" cellpadding="3">
   <thead>
      <tr>
	      <th>State Name</th>
	      <th>Min</th>
	      <th>Max</th>
	      <th width="20px"></th>
      </tr>
   </thead>
   <tbody>
<? $i = 0;
$optionsCopy = $urlOptions; 
$optionsCopy['controller'] = 'confirm';
$optionsCopy['action'] = 'deleterow';
$optionsCopy['c'] = 'stat';
   foreach ( $this->stats as $row ): 
      $optionsCopy['i'] = $row['id'] ?>
      <tr id="stat_<?= $row['id'] ?>" class="<?= $i++ % 2 ? 'even' : 'odd' ?>">
         <td valign="middle"><?= $row['name'] ?></td>
         <td valign="middle"><?= $row['min_value'] ?></td>
         <td valign="middle"><?= $row['max_value'] ?></td>
         <td>
            <a href="<?= $this->url($optionsCopy)?>" onClick="return deleteRow('stat','<?=$row['id']?>');"><img 
               id="stat_<?=$row['id']?>_img" src="/tools/images/delete_16.png" border="0" height="16" width="16" /></a>
         </td>
      </tr>
<? endforeach; ?>
   </tbody>
</table>

<br class="clear" />

<div class="toonStatForm">
<? $urlOptions = array ('module' => 'admin', 'controller' => 'role', 'action' => 'add'); ?>
<form id="role" action="<?= $this->url($urlOptions) ?>" onSubmit="return saveRow(this)" method="post">
<fieldset>
   <legend>Toons Roles</legend>
   <div class="row">
      <label for="role_name">Role Name:</label>
      <span class="form"><?= $this->formText('role_name', '', array('size' => 15)); ?></span>
   </div>
</fieldset>
<?= $this->formSubmit('submit', 'Save Role'); ?>
</form>
</div>

<table id="roleList" class="toonStatList" cellspacing="0" cellpadding="3">
   <thead>
      <tr>
         <th>Role Name</th>
         <th width="20px"></th>
      </tr>
   </thead>
   <tbody>
<? $i = 0;
$optionsCopy = $urlOptions; 
$optionsCopy['controller'] = 'confirm';
$optionsCopy['action'] = 'deleterow';
$optionsCopy['c'] = 'role';
foreach ( $this->roles as $row ): 
      $optionsCopy['i'] = $row['id'] ?>
      <tr id="role_<?= $row['id'] ?>" class="<?= $i++ % 2 ? 'even' : 'odd' ?>">
         <td valign="middle" height="20px"><?= $row['name'] ?></td>
         <td>
            <a href="<?= $this->url($optionsCopy)?>" onClick="return deleteRow('role','<?=$row['id']?>');"><img 
               id="role_<?=$row['id']?>_img" src="/tools/images/delete_16.png" border="0" height="16" width="16" /></a>
         </td>
      </tr>
<? endforeach; ?>
   </tbody>
</table>

<br class="clear" />

<div class="toonStatForm">
<? $urlOptions = array ('module' => 'admin', 'controller' => 'guild', 'action' => 'add'); ?>
<form id="guild" action="<?= $this->url($urlOptions) ?>" onSubmit="return saveRow(this)" method="post">
<fieldset>
   <legend>Toons Guilds</legend>
   <div class="row">
      <label for="guild_name">Guild Name:</label>
      <span class="form"><?= $this->formText('guild_name', '', array('size' => 15)); ?></span>
   </div>
   <div class="row">
      <label for="guild_server">Server Name:</label>
      <span class="form"><?= $this->formText('guild_server', '', array('size' => 15)); ?></span>
   </div>
</fieldset>
<?= $this->formSubmit('submit', 'Save Guild'); ?>
</form>
</div>

<table id="guildList" class="toonStatList" cellspacing="0" cellpadding="3">
   <thead>
      <tr>
	      <th>Guild Name</th>
	      <th>Server Name</th>
	      <th width="20px"></th>
      </tr>
   </thead>
   <tbody>
<? $i = 0;
$optionsCopy = $urlOptions; 
$optionsCopy['controller'] = 'confirm';
$optionsCopy['action'] = 'deleterow';
$optionsCopy['c'] = 'guild';
foreach ( $this->guilds as $row ):  
      $optionsCopy['i'] = $row['id'] ?>
      <tr id="guild_<?= $row['id'] ?>" class="<?= $i++ % 2 ? 'even' : 'odd' ?>">
         <td valign="middle"><?= $row['name'] ?></td>
         <td valign="middle"><?= $row['server_name'] ?></td>
         <td>
            <a href="<?= $this->url($optionsCopy)?>" onClick="return deleteRow('guild','<?=$row['id']?>');"><img 
               id="guild_<?=$row['id']?>_img" src="/tools/images/delete_16.png" border="0" height="16" width="16" /></a>
         </td>
      </tr>
<? endforeach; ?>
   </tbody>
</table>
